<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>16进制与rgba颜色转换 && canvas主色调取反色差</title>
  <style>
    .root {
      display: flex;
      flex-flow: column wrap;
      height: 800px;
      align-items: center;
    }
    .item {
      flex: 0 1 50%;
    }
    .display {
      width: 200px;
      height: 100px;
      border: 1px solid #eee;
      margin: 10px 0;
    }
    .margin_10 {
      margin: 10px 0;
    }
  </style>
</head>
<body>
  <div class="root">
    <div class="item">
      <h1>十六进制转rgba</h1>
      <div>
        <input type="text" id="input">
        <button id="transfer">转换</button>
      </div>
      <div>
        <div>
          <label for="reverseColor">反差色:</label>
          <input type="text" id="reverseColor">
          <div class="display" id="reverseColor_display"></div>
        </div>
        <div>
          <label for="rgba">rgba:</label>
          <input type="text" id="rgba">
          <div class="display" id="rgba_display"></div>
        </div>
      </div>
    </div>
    <div class="item">
      <h1>rgba转十六进制</h1>
      <div>
        <input type="text" id="input_r">
        <button id="transfer_r">转换</button>
      </div>
      <div>
        <div>
          <label for="reverseColor_r">反差色:</label>
          <input type="text" id="reverseColor_r">
          <div class="display" id="reverseColor_r_display"></div>
        </div>
        <div>
          <label for="rgb_r">rgba:</label>
          <input type="text" id="rgba_r">
          <div class="display" id="rgba_r_display"></div>
        </div>
      </div>
    </div>
    <div class="item">
      <h1>获取图片主色调</h1>
      <button id="upload" class="margin_10">上传图片</button>
      <div>
        <img id="upload_img">
      </div>
      <div>
        <label for="upload_r">主色调:</label>
        <input type="text" id="upload_r">
      </div>
      <div class="display" id="upload_r_display"></div>
    </div>
  </div>
  <script src="./index.js"></script>
</body>
</html>